﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crosland.Automotriz.Core;
using System.Data;
using System.Data.SqlClient;
using Crosland.Automotriz.Entidad;

namespace Crosland.Automotriz.Data.Dao.Linq
{
    public class clsT_Con_Operacion_TranDAO
    {
        private readonly AutomotrizEntities ContextoDeObjs = new AutomotrizEntities();

        public void GuardarOperacionTran(T_CON_OPERACION_TRAN entity)
        {

            ContextoDeObjs.ExecuteStoreCommand("exec USP_SAVE_T_CON_OPERACION_TRAN @OPERACION={0},@ID_CLIENTE={1},@ID_DOCUMENTO_AP={2},@NUM_DOCUMENTO_AP={3},@ID_DOCUMENTO={4},@NUM_DOCUMENTO={5},@ID_MONEDA={6},@IMP_BASE={7},@IMP_BASE_AP={8},@IMP_SALDO_BASE_DOC={9}",entity.ID_OPERACION,entity.ID_CLIENTE,entity.ID_DOCUMENTO_AP,entity.NUM_DOCUMENTO_AP,entity.ID_DOCUMENTO,entity.NUM_DOCUMENTO,entity.ID_MONEDA,entity.IMP_BASE,entity.IMP_BASE_AP,entity.IMP_SALDO_BASE_DOC);

        }

        public void GuardarLogicaTran(int idOperacion)
        {
            try
            {
                ContextoDeObjs.ExecuteStoreCommand("exec USP_GUARDAR_COMPENSACION_TRAN @ID_OPERA={0}", idOperacion);
            }
            catch (Exception)
            {

            }

        }

    }
}
